|
|
|
| |
|
|
|
|
The TabIndex property of a control is incremented by 1 each time a lower value is entered in another control. Therefore, by setting the TabIndex property of the txtISBN control to 0, you reset the value of the TabIndex property of txtTitle to 1, txtYearPub to 2, and so on. |
|
|
|
|
|
|
|
|
|
|
Figure 1.9.
Example data filling in blank fields
after clicking the Add button. |
|
|
|
|
|
|
|
|
If you didn't enter data into the data entry form that you created in this exercise in quite the same way as Figure 1.9 (for example, you incorrectly entered characters in the Year field, which only accepts numbers), you might have received an error message from Visual Basic 5 saying that you have invalid data in one of the fields. This is supposed to happen! Visual Basic 5 (more precisely, the Microsoft JET Engine) verifies all data entries to ensure that the correct data type is entered in each field. Input validation routines, a means of restricting data entry even further, are covered in depth on Day 5, "Input Validation," and error trapping is reviewed in the lesson on Day 14, "Error Handling in Visual Basic 5.0." You can skip over these messages for now. |
|
|
|
|
|
|
|
|
In today's lesson you learned the following: |
|
|
|
|
|
|
|
|
· You learned how to use the data control to bind a form to a database and data table by setting the DatabaseName and DataSource properties. |
|
|
|
|
|
|
|
|
· You learned how to use the textbox bound input control to bind an input box on the form to a data table and data field by setting the DataSource and DataField properties. |
|
|
|
|
|
|
|
|
· You learned how to combine standard command buttons and the AddNew and Delete methods to provide add record and delete record functionality to a data entry form. |
|
|
|
|
|